package org.jprobe;

import java.io.File;
/**
 * reflection supporting methods which deals with loading classes
 * in the class path or by a given directory.
 * @author Hussain Al-Mutawa
 * @version 1.0
 * @since 1.0
 */
public interface JavaProjectInterface {

	/**
	 * gets project directory
	 * @return file location of the project
	 */
	File getProjectDirectory();

	/**
	 * gets build directory
	 * @return file location of build
	 */
	File getBin();

	/**
	 * gets source <code>[project]/jprobe/src</code> folder in the
	 * project directory, this folder should contain test
	 * cases, generated by the implementing object.
	 * the hierarchy of the jprobe folder is as follows:
	 * <pre>
	 * 		[Project Folder]
	 * 		|
	 * 		+---[jprobe]
	 * 			|
	 * 			+----[src]
	 * 			|
	 * 			+----[bin]
	 * </pre>
	 */
	File getJprobeSrcFolder();

	/**
	 * gets source <code>[project]/jprobe/bin</code> folder in the
	 * project directory, this folder should contain test
	 * cases, generated by the implementing object.
	 * the hierarchy of the jprobe folder is as follows:
	 * <pre>
	 * 		[Project Folder]
	 * 		|
	 * 		+---[jprobe]
	 * 			|
	 * 			+----[src]
	 * 			|
	 * 			+----[bin]
	 * </pre>
	 */
	File getJprobeBinFolder();
	/**
	 * gets the library folder of the project
	 * @return the project library folder
	 */
	File getLib();
	/**
	 * reads the .classpath file and returns the set of files marked as lib resource
	 * @return list of libraries
	 * @throws Exception if the .classpath file is missing or not formed well as to Eclipse standards
	 */
	String[] getLibraries() throws Exception;

	/**
	 * loads the project, and prepares the classpath
	 * @throws Exception if loading the classpath has some invalid entries
	 */
	void load() throws Exception;
	/**
	 * unloads the project, and clears up the classpath
	 * @throws Exception if the classpath is in a state not allowing removing entries
	 */
	void unload() throws Exception;
	/**
	 * gets the packages defined in the build directory
	 * @return list of packages
	 */
	String[] getPackages();
	/**
	 * gets the name of the project
	 * @return the project name which is the same as the folder name
	 */
	String getName();
	/**
	 * determines if the project is loaded in the classpath
	 * @return true if loaded, false otherwise
	 */
	boolean isLoaded();
	/**
	 * gets a list of all of the classes in the project (binary name)
	 * @return array of classes in project
	 */
	String[] getClasses();

}
